package com.yiwyn;


import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.LoggerFactory;

@Slf4j
public class Main {
    public static void main(String[] args) {
        LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();
        Logger logger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
        // 创建带前缀的 Appender
        PrefixedAppender appender = new PrefixedAppender("MY_PREFIX: ");
        appender.setContext(loggerContext);
        appender.start();

        // 将 Appender 添加到 Logger
        logger.addAppender(appender);

        log.info("lomback日志");

        Test.test();

    }
}